package utilitaire;

public class UtilitaireOutils {

	
	public static String supprimerEspaceDebutFin(String valeur) {
		String res = valeur;
		if(valeur!=null && !valeur.equals("")) {
			StringBuilder resBuild = new StringBuilder(valeur);
			while (resBuild.indexOf(" ")==0) {
				resBuild = resBuild.deleteCharAt(0);
			}
			while (resBuild.lastIndexOf(" ")==resBuild.length()-1) {
				resBuild = resBuild.deleteCharAt(resBuild.length()-1);
			}
			res = resBuild.toString();
		}
		return res;
	}
	
	public static String ConvertMajuscule(String valeur) {
		return supprimerEspaceDebutFin(valeur.toUpperCase());
	}
}
